<!DOCTYPE html>
<html>
<head>
<meta name="window-area" content="left:0;top:0;width:720;height:570">
<meta charset="UTF-8">
<title>${title}</title>
<script type="text/javascript" src="/res/js/keydefine.js"></script>
<link rel="stylesheet" type="text/css" href="${res}/css/index.css" />
<script type="text/javascript">


var curFocusLoc=0;
var link=["/health/action/xywy","/health/action/xsyx","/health/action/qwjg","/health/action/myjt"];



document.onkeypress = grabevent;
document.onirkeypress = grabevent;
document.onkeydown = grabevent;
function grabevent()
{
	var val = event.keyCode?event.keyCode:event.which;  
	return keypress(val);
}

function keypress(key_val) 
{	
	switch (key_val) 
	{
		case 49:
		window.location.href="index.html";
		return 0;
		case KEY_UP :
		case KEY_PAGEUP: 
			pressKey_up();
			return 0;
		case KEY_DOWN :
		case KEY_PAGEDOWN:
			pressKey_down();
			return 0;
		case KEY_LEFT : 
			pressKey_left();		
			return 0;
		case KEY_RIGHT :
			pressKey_right();
			return 0;
		case KEY_OK :	
			pressKey_ok();			
			return 0;			
		case KEY_EXIT : 							
			return 0;
		default : 
			return 1;
	}
	return 0;
}

function pressKey_up()
{
	freeFocus();
	
	setFocus();
}


function pressKey_down()
{
	freeFocus();
	
	setFocus();
}

function pressKey_left()
{
	freeFocus();
	if(curFocusLoc>0 && curFocusLoc<=3)
	{
		curFocusLoc--;
	}
	setFocus();
}

function pressKey_right()
{
	freeFocus();
	if(curFocusLoc>=0 && curFocusLoc<3)
	{
		curFocusLoc++;
	}
	setFocus();
}
	
function setFocus()
{
	$("menu_"+curFocusLoc).style.backgroundImage="url(${res}/images/menu_"+curFocusLoc+"_focus.png)";
}

function freeFocus()
{
	$("menu_"+curFocusLoc).style.backgroundImage="url(${res}/images/menu_"+curFocusLoc+".png)";
}

function pressKey_ok()
{
	window.location.href=link[curFocusLoc];
}

function InitPage()
{
	initData();
	setFocus();
}
function initData() 
{
	for(var i=0;i<=3;i++)
	{
		$("menu_"+i).style.backgroundImage="url(${res}/images/menu_"+i+".png)";
	}
} 
</script>
</head>
<body onload="InitPage()" class="body_index">
	<div id="menu">
		<div id="menu_0" class="menuitem"></div>
		<div id="menu_1" class="menuitem"></div>
		<div id="menu_2" class="menuitem"></div>
		<div id="menu_3" class="menuitem"></div>
	</div>
</body>
</html>
